import request from '@/utils/request'
// 获取部门列表
export const getDepartmentAPI = () => {
  return request({
    url: '/company/department',
    method: 'get'
  })
}
// 获取部门负责人
export const getSimpleListAPI = () => {
  return request({
    url: '/sys/user/simple',
    method: 'get'
  })
}
// 获取部门详情
export const getDepartmentDetailsAPI = (id) => {
  return request({
    url: '/company/department/' + id,
    method: 'get'
  })
}
// 新增部门
export const addDepartmentAPI = ({ code, introduce, managerId, name }, pid) => {
  return request({
    url: '/company/department',
    method: 'post',
    data: {
      code,
      introduce,
      managerId,
      name,
      pid
    }
  })
}
// 编辑部门
export const putDepartmentAPI = ({ code, introduce, managerId, name, pid, id, createTime }) => {
  return request({
    url: '/company/department/' + id,
    method: 'put',
    data: {
      id,
      code,
      introduce,
      managerId,
      name,
      pid,
      createTime
    }
  })
}
// 删除部门
export const delDepartmentAPI = (id) => {
  return request({
    url: '/company/department/' + id,
    method: 'delete'
  })
}
